package com.mspbots.rule.queue.attendance;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @ClassName com.mspbots.rule.queue.attendance.BeforeWorkStartQueue
 * @Description TODO
 * @Author Jun
 * @Date 2019/9/17 12:24
 * @Version 1.0
 **/
@Slf4j
@Component
public class WorkScheduleQueue extends AttendanceBaseQueue {

    private static final String START_RULE_NAME = "BeforeWorkStart";

    private static final String END_RULE_NAME = "BeforeWorkEnd";

    private static final String LATE_RULE_NAME = "LateWorkStart";


//    @RabbitListener(queues = "trigger.attendance.BeforeWorkStart")
//    public void onQueue(List<TenantUserConfigurationDTO> tenantUserConfigurationDTOList) {
//        for (TenantUserConfigurationDTO tenantUserConfigurationDTO : tenantUserConfigurationDTOList) {
//            try {
//                super.onRule(START_RULE_NAME, tenantUserConfigurationDTO);
//            } catch (Exception e) {
//                log.error("BeforeWorkStart [{}] fire error : {}", START_RULE_NAME, e.getMessage());
//                e.printStackTrace();
//            }
//        }
//    }

//    @RabbitListener(queues = "trigger.attendance.BeforeWorkEnd")
//    public void beforeWorkEnd(List<TenantUserConfigurationDTO> tenantUserConfigurationDTOList) {
//        for (TenantUserConfigurationDTO tenantUserConfigurationDTO : tenantUserConfigurationDTOList) {
//            try {
//                super.onRule(END_RULE_NAME, tenantUserConfigurationDTO);
//            } catch (Exception e) {
//                log.error("BeforeWorkEnd [{}] fire error : {}", END_RULE_NAME, e.getMessage());
//                e.printStackTrace();
//            }
//        }
//
//    }

//    @RabbitListener(queues = "trigger.attendance.LateWorkStart")
//    public void lateWorkStart(List<TenantUserConfigurationDTO> tenantUserConfigurationDTOList) {
//        for (TenantUserConfigurationDTO tenantUserConfigurationDTO : tenantUserConfigurationDTOList) {
//            try {
//                super.onRule(LATE_RULE_NAME, tenantUserConfigurationDTO);
//            } catch (Exception e) {
//                log.error("LateWorkStart [{}] fire error : {}", LATE_RULE_NAME, e.getMessage());
//                e.printStackTrace();
//            }
//        }
//
//    }

}
